{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7aa73054-b6d7-4a3e-b4ca-817714f9420f",
   "metadata": {},
   "source": [
    "pyecharts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "52635299-0895-493e-9efc-c9927e4c8347",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.0.6\n"
     ]
    }
   ],
   "source": [
    "import pyecharts\n",
    "print(pyecharts.__version__)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4d7a9694-e8d7-4925-b78a-350ea55cf372",
   "metadata": {},
   "source": [
    "进行网页的图表编写"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a6ef7df2-d9ba-4e82-9621-61c93f4bb151",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"31073dcec2864414bee5d42812b76cfa\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_31073dcec2864414bee5d42812b76cfa = echarts.init(\n",
       "                    document.getElementById('31073dcec2864414bee5d42812b76cfa'), 'white', {renderer: 'canvas'});\n",
       "                var option_31073dcec2864414bee5d42812b76cfa = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#5470c6\",\n",
       "        \"#91cc75\",\n",
       "        \"#fac858\",\n",
       "        \"#ee6666\",\n",
       "        \"#73c0de\",\n",
       "        \"#3ba272\",\n",
       "        \"#fc8452\",\n",
       "        \"#9a60b4\",\n",
       "        \"#ea7ccc\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6 A\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                5,\n",
       "                20,\n",
       "                36,\n",
       "                10,\n",
       "                75,\n",
       "                90\n",
       "            ],\n",
       "            \"realtimeSort\": false,\n",
       "            \"showBackground\": false,\n",
       "            \"stackStrategy\": \"samesign\",\n",
       "            \"cursor\": \"pointer\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6 A\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u886c\\u886b\",\n",
       "                \"\\u7f8a\\u6bdb\\u886b\",\n",
       "                \"\\u88e4\\u5b50\",\n",
       "                \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                \"\\u889c\\u5b50\",\n",
       "                \"\\u96ea\\u7eba\\u886b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_31073dcec2864414bee5d42812b76cfa.setOption(option_31073dcec2864414bee5d42812b76cfa);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x19b2a2c74a0>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "\n",
    "bar = Bar()  # 实例化对象\n",
    "bar.add_xaxis(['衬衫','羊毛衫','裤子','高跟鞋','袜子','雪纺衫']) # 添加x轴\n",
    "bar.add_yaxis(\"商家 A\",[5,20,36,10,75,90])  # 添加y轴\n",
    "\n",
    "bar.render(\"商家数据分析图.html\")  # 生成网页信息\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e92a822b-5e3b-4558-9138-aad6632f4ab9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"aec1b5da1c8f447788ca4fdcdb6b0b53\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_aec1b5da1c8f447788ca4fdcdb6b0b53 = echarts.init(\n",
       "                    document.getElementById('aec1b5da1c8f447788ca4fdcdb6b0b53'), 'white', {renderer: 'canvas'});\n",
       "                var option_aec1b5da1c8f447788ca4fdcdb6b0b53 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#5470c6\",\n",
       "        \"#91cc75\",\n",
       "        \"#fac858\",\n",
       "        \"#ee6666\",\n",
       "        \"#73c0de\",\n",
       "        \"#3ba272\",\n",
       "        \"#fc8452\",\n",
       "        \"#9a60b4\",\n",
       "        \"#ea7ccc\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u624b\\u673a\\u5382\\u5bb6-goods\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                20,\n",
       "                36,\n",
       "                10,\n",
       "                75,\n",
       "                90\n",
       "            ],\n",
       "            \"realtimeSort\": false,\n",
       "            \"showBackground\": false,\n",
       "            \"stackStrategy\": \"samesign\",\n",
       "            \"cursor\": \"pointer\",\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u624b\\u673a\\u5382\\u5bb6-goods\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u534e\\u4e3a\",\n",
       "                \"\\u5c0f\\u7c73\",\n",
       "                \"oppo\",\n",
       "                \"vivo\",\n",
       "                \"\\u8363\\u8000\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_aec1b5da1c8f447788ca4fdcdb6b0b53.setOption(option_aec1b5da1c8f447788ca4fdcdb6b0b53);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x19b2c73d460>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "\n",
    "bar = Bar()  # 实例化对象\n",
    "bar.add_xaxis(['华为','小米','oppo','vivo','荣耀']) # 添加x轴\n",
    "bar.add_yaxis(\"手机厂家-goods\",[20,36,10,75,90])  # 添加y轴\n",
    "\n",
    "bar.render(\"手机销售数据图.html\")  # 生成网页信息\n",
    "bar.render_notebook()  # 在jupyter中写，在pycharm中不写。也可以不写"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "180f20a2-a521-4279-838d-8b56b6bf5a40",
   "metadata": {},
   "source": [
    "【1】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7de6f8a5-088b-439e-883d-1198a938a68f",
   "metadata": {},
   "source": [
    "在 Pyecharts 中有两种绘图方式, 普通绘制及链式调用方式进行绘制"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8aabe84b-a8fa-4c9e-95c4-330eacac1067",
   "metadata": {},
   "source": [
    "普通绘制"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "375f4a7d-5401-498e-b43d-bc77c2c34c67",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\jupyter\\\\render.html'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "\n",
    "bar = Bar()  # 实例化对象\n",
    "bar.add_xaxis(['衬衫','羊毛衫','裤子','高跟鞋','袜子','雪纺衫']) # 添加x轴\n",
    "bar.add_yaxis(\"商家 A\",[5,20,36,10,75,90])  \n",
    "bar.add_yaxis(\"商家 B\",[90,2,36,18,70,9])  \n",
    "bar.load_javascript()\n",
    "bar.render()  # 如果里面不写，默认生成render.html网页"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fdf1ee22-fb34-440e-ac4c-71523e41f5f1",
   "metadata": {},
   "source": [
    "链式调用y轴"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "70aee9ec-16ea-4a77-befc-3044a0665203",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\jupyter\\\\链式调用.html'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "\n",
    "bar = (Bar().add_xaxis(['衬衫','羊毛衫','裤子','高跟鞋','袜子','雪纺衫'])\n",
    "      .add_yaxis(\"商家 A\",[5,20,36,10,75,90])\n",
    "      .add_yaxis(\"商家 B\",[90,2,36,18,70,9])) \n",
    "bar.render(\"链式调用.html\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8d279d97-54e0-46a4-93d7-a20a4f9592df",
   "metadata": {},
   "source": [
    "【2】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d06b68e3-2f1d-4c51-adb6-b34711daa474",
   "metadata": {},
   "source": [
    "配置项"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8bd14445-addd-4db7-8be7-22c09f8be411",
   "metadata": {},
   "source": [
    "opts对象可以调用一切"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d9a2b981-95cc-40fa-b378-48a05d87adef",
   "metadata": {},
   "source": [
    "使用 options 配置项，在 pyecharts 中，一切皆 Options。Pyecharts 中配置项分为两类，一类是全局配置项，一\n",
    "类是系列配置项。下面的示例中, 我们通过全局配置项目, 为图表添加了一个名称!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "0496ba0c-68a5-4af2-aa1d-e834ba34c5ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\jupyter\\\\render.html'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "from pyecharts import options as opts\n",
    "# pyecharts默认支持中文字体\n",
    "bar = (\n",
    "    Bar()\n",
    "    .add_xaxis(['衬衫','羊毛衫','裤子','高跟鞋','袜子','雪纺衫'])\n",
    "    .add_yaxis(\"商家 A\",[5,20,36,10,75,90])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"主标题\",subtitle=\"副标题\"))\n",
    ")\n",
    "bar.render()  # 如果里面不写，默认生成render.html网页"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fe593a8d-5bc8-4b97-8698-39c21925b0f9",
   "metadata": {},
   "source": [
    "全局配置项"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "051f4217-17f1-43dd-9d87-8dcf46fbf81a",
   "metadata": {},
   "source": [
    "全局配置可以通过set_global_opts方法进行设置可以通过全局配置项，自定义 charts 图的标题、图例、提示\n",
    "框、工具箱等展示内容。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "30cf7eaa-a015-4425-b2fb-e8fa14a09656",
   "metadata": {},
   "source": [
    "\n",
    "AnimationOpts：Echarts 画图动\n",
    "h\r\n",
    "InitOpts：初始化项\r\n",
    "h\r\n",
    "ToolBoxFeatureSaveAsImagesOpts存图片\r\n",
    "h\r\n",
    "ToolBoxFeatureRestoreOpts: 工还原配置项\r\n",
    "h\r\n",
    "ToolBoxFeatureDataViewOpts工具箱数据视图\r\n",
    "h\r\n",
    "ToolBoxFeatureDataZoOpts：区域缩放\r\n",
    "h\r\n",
    "ToolBoxFeatureMagicTyOpts：动态类型切换\r\n",
    "h\r\n",
    "ToolBoxFeatureBrhOpts：工具箱选框组件\r\n",
    "h\r\n",
    "ToolBoxFeareOpts：工具箱工具配置项\r\n",
    "h\r",
    "oolboxOpts：工具箱配置项\r\n",
    "hBrushOpts：区域选择组件项\r\n",
    "h\r\n",
    "TitleOpts：标题配置项h\r\n",
    "DataZoomOpts：区放配置项\r\n",
    "h\r\n",
    "LegendOpts：图例项\r\n",
    "h\r\n",
    "VisualMapOpts觉映射配置项\r\n",
    "h\r\n",
    "TooltipOpts：框配置项\r\n",
    "h\r\n",
    "AxisLineOpts: 轴轴线配置项\r\n",
    "h\r\n",
    "AxisTickOpts: 坐标度配置项\r\n",
    "h\r\n",
    "AxisPoierOpts: 坐标轴指示器配置项\r\n",
    "h\r",
    "xisOpts：坐标轴配置项\r\n",
    "h\r\n",
    "SineAxisOpts：单轴配置项\r\n",
    "h\r\n",
    "aphicGroup：原生图形元素组件\r\n",
    "h\r\n",
    "GraphicIm：原生图形配置项\r\n",
    "h\r\n",
    "GraphicBasicSleOpts：原生图形基础配置项\r\n",
    "h\r\n",
    "GrhicShapeOpts：原生图形形状配置项\r\n",
    "h\r\n",
    "GrapcImage：原生图形图片配置项\r\n",
    "h\r\n",
    "GphicImageStyleOpts：原生图形图片样式\r\n",
    "h\r",
    "raphicText：原生图形文本配置项\r\n",
    "\n",
    "GraphicTextStyleOpts: 原生图形文本样式\r\n",
    "h\r\n",
    "GraphicRect：原生图形矩形配置项\r\n",
    "h\r\n",
    "PolarOpts：极坐标系配置"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9642a9df-2777-4ceb-871a-3c082c92db44",
   "metadata": {},
   "source": [
    "系列配置项"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0e2aba26-7bfe-492d-9e2e-59d3b825360e",
   "metadata": {},
   "source": [
    "系列配置可以通set_series_opts 方法进行设置，通过系列配置项，可以对文字、图元等样式进行配置。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "66e54967-c599-4ba3-a3ba-7ce820d5c5cf",
   "metadata": {},
   "source": [
    "\n",
    "ItemStyleOpts：图元样式配置\n",
    "h\r\n",
    "TextStyleOpts：文字样式项\r\n",
    "h\r\n",
    "LabelOpts：配置项\r\n",
    "h\r\n",
    "LineStyleOpts样式配置项\r\n",
    "h\r\n",
    "Lines3DEffectOpts:  线样式配置项\r\n",
    "h\r\n",
    "SplitLinets：分割线配置项\r\n",
    "h\r\n",
    "MarkPoiItem：标记点数据项\r\n",
    "h\r\n",
    "MarkPntOpts：标记点配置项\r\n",
    "h\r\n",
    "MaLineItem：标记线数据项\r\n",
    "h\r\n",
    "rkLineOpts：标记线配置项\r\n",
    "h\r\n",
    "rkAreaItem: 标记区域数据项\r\n",
    "hMarkAreaOpts: 标记区域配\r\n",
    "h\r\n",
    "EffectOpts：涟漪特效配置项\r",
    "\r\n",
    "AreaStyleOpts：区域填充样式项\r\n",
    "h\r\n",
    "SplitAreaOpts：分隔配置项\r\n",
    "h\r\n",
    "MinorTickOpts：次级刻度配置项\r\n",
    "h\r\n",
    "MinorSplitLineOpts：次级分割线配置项"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "661a69f5-6089-4303-bd8f-f12786d83e9d",
   "metadata": {},
   "source": [
    "【3】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8e8bb36d-b661-4486-bf17-3377734cfb27",
   "metadata": {},
   "source": [
    "使用主题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "999a7047-d79c-4d83-9ce7-d3fe47ae00a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\jupyter\\\\render.html'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "from pyecharts import options as opts\n",
    "# 内置主题类型可查看 pycharts.globals.ThemeType\n",
    "from pyecharts.globals import ThemeType\n",
    "\n",
    "bar = (\n",
    "    # 初始化设置主题\n",
    "    Bar(init_opts=opts.InitOpts(theme=ThemeType.DARK))\n",
    "    .add_xaxis(['衬衫','羊毛衫','裤子','高跟鞋','袜子','雪纺衫'])\n",
    "    .add_yaxis(\"商家 A\",[5,20,36,10,75,90])\n",
    "    .add_yaxis(\"商家 B\",[90,2,36,18,70,9])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"商家销售数据\",subtitle=\"商家A和商家B\"))\n",
    ")\n",
    "bar.render()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "27a6447b-f0cc-42e7-9297-535f403bd523",
   "metadata": {},
   "source": [
    "【4】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e7129ac7-bd22-4ce9-8cf2-957a7f03fb18",
   "metadata": {},
   "source": [
    "图表的基本类型"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f3be19f1-26fc-4df4-bd2a-b96936a473d4",
   "metadata": {},
   "source": [
    "1 局部整体型图表"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3dbdf5cb-07c5-4507-af16-089380d3582b",
   "metadata": {},
   "source": [
    "局部整体型图表能显示出局部组成成分与整体的占比信息，主要包括饼图、圆环图、旭日图、华夫饼图、矩\n",
    "形树状图等）。饼图是用来呈现部分和整体关系的常见方式，在饼图中，每个扇区的弧长（以及圆心角和面积\r\n",
    "大小为其所表示的数量的比例。但要注意的是，这类图很难去精确比较不同组成的大小。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "08c5f437-1a07-426f-ac13-71fbf41ba4f1",
   "metadata": {},
   "source": [
    "2 数据分布形图表"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a6b8476c-cb0f-48bc-8b49-b21523f628c6",
   "metadata": {},
   "source": [
    "数据分布型图表主要显示数据集中的数值及其出现的频率或者分布规律，包括统计直方图、核密度曲线图、\n",
    "箱形图、小提琴图等。其中，统计直方图最为简单与常见，又称质量分布图，由一系列高度不等的纵向条纹或\r\n",
    "段表示数据分布的情况。一般用横轴表示数据类型，纵轴表示分布情况"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "58e75cd0-f605-4dd6-a922-9d30a14396c8",
   "metadata": {},
   "source": [
    "3 类别比较型图表"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0410995b-833a-49be-9e53-c8d9c27e29c0",
   "metadata": {},
   "source": [
    "类别比较型图表的数据一般包含数值型和类别型两种数据类型 [1.5]，比如在柱形图中，X 轴为类别型数据，\n",
    "Y 轴为数值型数据，采用位置 + 长度两种视觉元素。类别型数据主要包括柱形图、条形图、雷达图、坡度图、\r\n",
    "云图等，通常用来比较数据的规模。有可能是比较相对规模（显示出哪一个比较大），有可能是比较绝对规模需\r\n",
    "要显示出精确的差异）。柱形图是用来比较规模的标准图表（注意：柱形图轴线的起始值必须为 0）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "44004037-f079-4068-8a0d-bac719201878",
   "metadata": {},
   "source": [
    "4 数据关系型图表"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3b28d462-7525-4fdb-aaae-72d8dcf29e89",
   "metadata": {},
   "source": [
    "数据关系型图表分为数值关系型、层次关系型和网络关系型三种图表类型."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e291ad56-f52b-43fc-96ab-f6aedb635bc4",
   "metadata": {},
   "source": [
    "5 时间序列"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3b9dfea-09c0-413d-bdd8-8dd51d90ce80",
   "metadata": {},
   "source": [
    "时间序列型图表强调数据随时间的变化规律或者趋势，X 轴一般为时序数据，Y 轴为数值型数据，包括折线\n",
    "图、面积图、雷达图、日历图、柱形图等。其中，折线图是用来显示时间序列变化趋势的标准方式，非常适用\r\n",
    "显示在相等时间间隔下数据的趋势"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "57e2c1cc-aff8-4f81-a2e6-174c9bad11d9",
   "metadata": {},
   "source": [
    "6 地理空间"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d872f782-892f-4b54-af5b-787cd28c4c62",
   "metadata": {},
   "source": [
    "地理空间型图表主要展示数据中的精确位置和地理分布规律，包括等值区间地图、带气泡的地图、带散点\n",
    "的地图等。地图用地理坐标系可以映射位置数据。位置数据的形式有许多种，包括经度、纬度、邮编等，但通\r\n",
    "都是用纬度和经度来描述的。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
